package xin.mashibo.pattern.observer;

import java.util.concurrent.TimeUnit;

/**
 * 数字形式观察者
 *
 * @author MaShibo
 * 日期 :  2019/1/28
 */
public class DigitObserver implements Observer {


    @Override
    public void update(NumberGenerator generator) {
        System.out.println("DigitObserver: " + generator.getNumber());
        try {
            TimeUnit.MILLISECONDS.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
